package com.Maykk.Demo11;

import java.util.function.Consumer;

/**
 * @ClassName: Demo01
 * @Description: TODO Consumer 消费者接口
 * @Author: MaykkStar@163.com
 */
public class Demo01 {
    public static void main(String[] args) {
        String[] infoArr = {"东邪:黄固", "西毒:欧阳锋", "南帝:段智兴", "北丐:洪七公", "中神通:王重阳"};
        printInfo(infoArr,
                info -> System.out.println(info.split(":")[0]),
                info -> System.out.println(info.split(":")[1])
        );
    }

    public static void printInfo(String[] info, Consumer<String> con01, Consumer<String> con02) {
        for (String str : info) {
            con01.andThen(con02).accept(str);
            // 输出分隔输出行
            System.out.println("''''''''''''");
        }
    }
}
